﻿using System.Linq;
using JinTai.MemorialTablets.Interfaces;
using NHibernate.Burrow;
using NHibernate.Linq;

namespace JinTai.MemorialTablets.Dao.NHibernateImple
{
    public class MemorialTabletFactory : IMemorialTabletFactory
    {
        private readonly BurrowFramework bf = new BurrowFramework();

        #region IMemorialTabletFactory 成员

       

        public IContactDao CreateContactDao()
        {
            return new ContactDao();
        }

        public IMemorialTabletDao CreateMemorialTabletDao()
        {
            return new MemorialTabletDao();
        }

       
        public IPositionMemberDao CreatePositionMemberDao()
        {
            return new PositionMemberDao();
        }

        public IQueryable<Contact> Contacts
        {
            get { return bf.GetSession(typeof (Contact)).Linq<Contact>(); }
        }

        #endregion
    }
}